package com.lht.designPattern.state;

import java.util.UUID;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-10-12
 */
public class Demo {

    public static void main(String[] args) {
        //初始一个最新的订单
        Order order = new Order(1L, UUID.randomUUID().toString(), 0);

        OrderStateContext context = new OrderStateContext();
        if (context.isChange(order, 1)) {
            context.change(order, 1);
        }

        if (context.isChange(order, 2)) {
            context.change(order, 2);
        }
    }

}
